import request from '@/utils/request'

/**
 * 获取用户列表数据
 */

export const getUserManageList = (data) => {
  return request({
    url: '/user/list',
    params: data
  })
}
/**
 * 批量上传用户
 */
export const userBatchImport = (data) => {
  return request({
    url: '/user/batch/import',
    method: 'POST',
    data
  })
}

/**
 * 禁用指定用户
 */
export const disableUser = (id) => {
  return request({
    url: `/user/disable/${id}`
  })
}

/**
 * 禁用指定用户
 */
export const enableUser = (id) => {
  return request({
    url: `/user/enable/${id}`
  })
}
/**
 * 重置密码
 */
export const resetPassword = (id) => {
  return request({
    url: `/user/resetPassword/${id}`
  })
}

/**
 * 获取所有用户
 */
export const getUserAll = () => {
  return request({
    url: '/user/all'
  })
}

/**
 * 获取用户详情
 */
export const userDetail = (id) => {
  return request({
    url: `/user/detail/${id}`
  })
}

/**
 * 获取指定用户的角色
 */
export const uerRoles = (id) => {
  return request({
    url: `/user/role/${id}`
  })
}

/**
 * 获取指定用户的角色
 */
export const updateRole = (id, data) => {
  return request({
    url: `/user/update-role/${id}`,
    method: 'POST',
    data
  })
}
/**
 * 创建用户
 */
export const createUser = (data) => {
  return request({
    url: '/user/create',
    method: 'POST',
    data
  })
}

/**
 * 编辑用户信息
 */
export const editorUser = (data) => {
  return request({
    url: '/user/edit',
    method: 'POST',
    data
  })
}
